<?php 
require('include/book.php');
require('include/authority.php');
if(!Authority::is_manager())
  {
    die('FAIL');
  }
$name = $_GET['name'];
$ID = $_GET['ID'];
$publisher =$_GET['publisher'];
$location = $_GET['location'];
if(!isset($name,$ID,$publisher,$location))
  {
    die('FAIL');
  }
$book = new Book($ID,$name,$publisher,$location,true);
if(!$book)
  {
    die('FAIL');
  }
if(!$book->save_this())
  { 
    die('FAIL');
  }
die('OK');
?>